package com.sword.demo.sentinel.interfaces.api;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户接口
 * @author sword
 * @date 2022/1/11 21:15
 */
@RestController
@Api(tags = "用户接口")
@RequestMapping("/user")
@RequiredArgsConstructor
public class UserApi {

    /**
     * 用户名称
     */
    @Value("${user.name}")
    private String userName;

    /**
     * 获取用户名称
     * @return java.lang.String
     * @author sword
     * @date 2022/1/11 21:16
     */
    @GetMapping("/name")
    @ApiOperation("获取用户名称")
    public String getUserName() {
        return userName;
    }
}
